package com.example.dou2204.baseMVVM;

import android.os.Bundle;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.databinding.DataBindingUtil;
import androidx.databinding.ViewDataBinding;
import androidx.lifecycle.ViewModelProvider;

public abstract class BaseViewActivity<VBD extends ViewDataBinding> extends AppCompatActivity {
    protected VBD binding;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        binding = DataBindingUtil.setContentView(this,bindLayout());

        initView();
        initData();
    }

    protected abstract void initData();//初始化数据请求

    protected abstract void initView();//初始化控件

    protected abstract int bindLayout();//绑定控件
}
